<?php
	error_reporting(0);
	include("common/connection.php");
	$search=$_GET['search'];
	$queryUser="SELECT max(id) as id FROM `users`";
	$resultUser=mysql_db_query($db_name,$queryUser);
	$rsUser=mysql_fetch_array($resultUser);
	$group=$_POST['group'];
	if($group=='')$group='%';
	if($group=='1')$group='Science';
	if($group=='2')$group='Commerce';
	if($group=='3')$group='Arts';
	$batch=$_POST['batch'];
	if($batch==''||$batch=='---')$batch='%';
	$name=$_POST['name'];
	if($name!='')$name='%'.$name.'%';
	if($name=='')$name='%';
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="style.css" />
<link rel="stylesheet" href="formStyle.css" type="text/css" />
<link rel="stylesheet" href="tomal_style.css" type="text/css" />
<link rel="stylesheet" href="style_countdown.css" type="text/css" />

<script src="jquery.min.js" type="text/javascript"></script>
<script type="text/javascript" src="jquery.countdown.pack.js"></script>
<script language="javascript" type="text/javascript">

function getXMLHTTP() { //fuction to return the xml http object
		var xmlhttp=false;	
		try{
			xmlhttp=new XMLHttpRequest();
		}
		catch(e)	{		
			try{			
				xmlhttp= new ActiveXObject("Microsoft.XMLHTTP");
			}
			catch(e){
				try{
				xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
				}
				catch(e1){
					xmlhttp=false;
				}
			}
		}
		 	
		return xmlhttp;
    }
	
	function getBatch(groupId) {		
		
		var strURL="findbatch.php?group="+groupId;
		var req = getXMLHTTP();
		
		if (req) {
			
			req.onreadystatechange = function() {
				if (req.readyState == 4) {
					// only if "OK"
					if (req.status == 200) {						
						document.getElementById('statediv').innerHTML=req.responseText;						
					} else {
						alert("There was a problem while using XMLHTTP:\n" + req.statusText);
					}
				}				
			}			
			req.open("GET", strURL, true);
			req.send(null);
		}		
	}
	
	function AjaxFunction(email)
	{
		//alert(email);
		var url="validation.php";
		url=url+"?email="+email;
		url=url+"&sid="+Math.random();
		var reqEmqil = getXMLHTTP();
		
		if (reqEmqil) {
			
			reqEmqil.onreadystatechange = function() {
				if (reqEmqil.readyState == 4) {
					// only if "OK"
										
						document.getElementById("msg").innerHTML=reqEmqil.responseText;						
					
				}				
			}			
			reqEmqil.open("GET", url, true);
			reqEmqil.send(null);
		}
	 
	}
	
</script>
<script type="text/javascript">
$(function () {
$('#countdown').countdown({until:$.countdown.UTCDate(+6, 2012,  3 - 1, 23), format: 'DHMS', layout: 
	  '<div id="timer">' + '<hr />'+
		  '<div id="timer_days" class="timer_numbers">{dnn}</div>'+
		  '<div id="timer_hours" class="timer_numbers">{hnn}</div>'+ 
		  '<div id="timer_mins" class="timer_numbers">{mnn}</div>'+
		  '<div id="timer_seconds" class="timer_numbers">{snn}</div>'+
		'<div id="timer_labels">'+
			'<div id="timer_days_label" class="timer_labels">days</div>'+
			'<div id="timer_hours_label" class="timer_labels">hours</div>'+
			'<div id="timer_mins_label" class="timer_labels">mins</div>'+
			'<div id="timer_seconds_label" class="timer_labels">secs</div>'+
		'</div>'+							
	'</div>'
						  
});
});
</script>


<title>Banani Bidyaniketan: 40 Years Celebration & Reunion - 2012</title>
</head>

<body>
<div id="main_div">
	<div id="main_div_upper_shadow"></div><!-- end of main_div_upper_shadow-->
    <div id="main_div_upper_black"></div><!-- end of main_div_upper_black-->
    
    <div id="main_div_banner_top">
    	<!--<div id="logo"></div>--><!-- end of logo -->
    	<!--<div id="header1"></div>--><!-- end of header1-->
        
        
    </div><!-- end of main_div_banner_top-->
    <div class="black_search_box"><a href="index.php">Home</a></div>
    <div id="middle_black_body">
    	<p class="countdown_header">Time Left for Reunion Day</p>
        <p class="registration_header">Total Registered</p>
		<?php 
			$origi=$rsUser['id']; 
			$total=(100+$origi);
			if($total<1000){$total="0".$total;}			
		?>
        <div class="total_registered"><img src="images/total_registerd.PNG" /><p><?php echo $total;?></p></div>
    
    	<div id="countdown"></div>    
    
    	<!--<div class="venue1">
        	<p style=" color:#FF4B00; font-weight:bold; margin-bottom:-21px;">Date</p>
            <p style=" color:#FFF; font-weight:bold;">27 January 2012</p>
        </div>
        <div class="venue2">
        	<p style=" color:#FF4B00; font-weight:bold; margin-bottom:-21px;">Venue</p>
            <p style=" color:#FFF; font-weight:bold;">Bangabandhu International Conference Centre</p>
        </div>
        <div class="venue3">
        	<p style=" color:#FF4B00; font-weight:bold; margin-bottom:-21px;">Time</p>
            <p style=" color:#FFF; font-weight:bold;">3pm - 11pm</p>
        </div>-->
    </div><!-- end of middle_black_body -->
    
    <div id="after_middle_black_body">
   		<div id="after_middle_curvy_top"></div>
        <div id="after_middle_normal_body">
        	
        	<p class="header_p1" style="font-size:18px !important">Reunion - 2012 Registration List & Search your batch mate</p>
			<p style="font-size:16px; font-weight:bold" align="center">(Please contact Organizing body(2008 batch) for clarification or information)</p>
            
           
            
            <div class="container"  style=" height:auto;">
                <form name="regis" action="bobi.php?search=result" method="post">
                    <table cellspacing="0" cellpadding="8" align="center">
                        <tr>
                            
                                
                            <td valign="middle"> Batch </td>
                            <td valign="middle"> <div id="statediv" style="position:absolute"><select name="batch" id="batch" >
										<option value="">---</option>
                                    <?php 
										for($i=2012;$i>=1972; $i--){
									?>
                                    	<option value="<?php echo $i;?>" <?php if($batch==$i){?>selected="selected"<?php }?>>
											<?php echo $i;?>
                                        </option>
                                    <?php }?>
											</select></div>  
                                 <br/>
                            </td>
                            
                            <td></td><td></td><td></td>
                            <td valign="middle"> Group </td>
                            <td valign="middle"> 
								<select name="group" id="group" class="validate[required]">
                                  <option value="">&nbsp;&nbsp;- - -</option>
								  <option value="1">Science</option>
								  <option value="2">Commerce</option>
								  <option value="3">Arts</option>
								</select>
                                 <br/> 
                            </td>
                            
                            <td></td><td></td><td></td>
                            <td> Name </td>
                            <td colspan="2"><input type="text" name="name" class="textstyle"/> <br/> </td>
                        </tr>
                        </table>
                        
                        <input type="submit" value="Submit" class="oxava" style="float:right; margin-right: 396px;"/>
						</form>
						
                        <?php 
							if($search=='result'){
								
						?>
                        <div class="alumni_table">
                        <table id="hor-minimalist-a" summary="Employee Pay Sheet">
                        	<colgroup>
                                <col width="70px" />
                                <col width="300px" />
                                <col width="80px" />
                                <col width="120px" />
                                <col width="185px" />
                                <col width="80px" />
                                <col width="100px" />
                            </colgroup>
                            <thead>
                                <tr>
                                    <th scope="col">Sl no.</th>                                    
                                    <th scope="col">Name</th>                                    
                                    <th scope="col">Batch</th>
                                    <th scope="col">Group</th>
                                    <th scope="col">Spouse Inclueded</th>
                                    <th scope="col">Kids</th>
                                    <th scope="col">Reg.Status</th>
                                </tr>
                            </thead>
                            <tbody>
							<?php
								
								/*if (!(isset($pagenum))) { 
									$pagenum = 1; 
 								} 
								$data = mysql_query("SELECT * FROM tmembers WHERE `batch` LIKE  '$batch' AND `mgroup` LIKE  '$group' AND `name` LIKE  '$name' order by mgroup, batch") or die(mysql_error()); 
 								$pagerows = mysql_num_rows($data); 
								$i=1;
								$page_rows = 5; 
								$last = ceil($pagerows/$page_rows);
								if ($pagenum < 1){ 
								 $pagenum = 1; 								
								 } 								
								 elseif ($pagenum > $last) 								
								 { 								
									 $pagenum = $last; 								
								 } 
								 $max = 'limit ' .($pagenum - 1) * $page_rows .',' .$page_rows; */
								$sql="SELECT * FROM users WHERE `batch` LIKE  '$batch' AND `group` LIKE  '$group' AND `f_name` LIKE  '$name' and is_delete=0  order by  batch";
								$result=mysql_query($sql);
								$i=1;
								//$norows=mysql_num_rows($result);
								$stdgroup[1]="Science";
								$stdgroup[2]="Commerce";
								$stdgroup[3]="Arts";
								$regstat[0] = "<span style='color:red;'>Pending</span>";
								$regstat[1] = "<span style='color:green;'>Completed</span>";
								
								while($row=mysql_fetch_assoc($result)){
									$dbg = $row["group"];
									$rst=$row['status']; 
									$sstat = $row['spouse'];
									if($sstat =='')
										$spouseMsg = "No";
									else
										$spouseMsg = "Yes";
									
							?>
                                <tr>
                                    <td ><?php echo $i;?></td>                                    
                                    <td><?php echo $row['f_name'];?></td>                                    
                                    <td><?php echo $row['batch'];?></td>
                                    <td><?php echo $stdgroup[$dbg];?></td>
                                    <td style="text-align:center;"><?php echo $spouseMsg;?></td>
                                    <td><?php echo $row['member']-1;?></td>
                                    <td><?php echo $regstat[$rst];?></td>
                                </tr>
							<?php $i++;}?>
								<tr>
									<td colspan="4" align="center">
									<?php
										/*if ($pagenum == 1) { } 								
										 else  {								
											echo " <a  style='text-decoration:none; font-family:Arial, Helvetica, sans-serif; font-size:12; color:#8db11a;'  href='{$_SERVER['PHP_SELF']}?pagenum=1'> <<-First</a> ";								
											echo " ";								
											$previous = $pagenum-1;								
											echo " <a style='text-decoration:none; font-family:Arial, Helvetica, sans-serif; font-size:12; color:#8db11a;' href='{$_SERVER['PHP_SELF']}?pagenum=$previous'> <-Previous</a> ";								
										 } 
										 if ($pagenum == $last) { } 
										
										 else {								
											 $next = $pagenum+1;								
											 echo " <a style='text-decoration:none; font-family:Arial, Helvetica, sans-serif; font-size:12; color:#8db11a;' href='{$_SERVER['PHP_SELF']}?pagenum=$next'>Next</a> ";
											
											 echo " ";								
											 echo " <a style='text-decoration:none; font-family:Arial, Helvetica, sans-serif; font-size:12; color:#8db11a;' href='{$_SERVER['PHP_SELF']}?pagenum=$last'>Last</a> ";
										
										 } */
									?>  
									</td>
								</tr>                              
                            </tbody>
                        </table>
                        </div>
                <?php } ?>
            </div><!-- end of container -->
          </div>
        <div id="after_middle_curvy_bottom"></div>
    </div><!-- end of after_middle_black_body -->
    
</div><!-- end of main_div -->
<div class="webpers_logo">
	<p class="copy_right">&copy; 2012, all right reserverd to <a href="https://www.webpers.com" style="color:#0066FF; font-weight:bold;">2008 Batch</a></p>
    <div class="left_static_1">
        
        <ul>
        	<li><p class="powered_by">Powered By <a href="http://www.webpers.com" style="color:#0066FF; font-weight:bold;"> webpers.com </a></p></li>
            <li><a href="http://www.webpers.com" style="overflow:hidden"><div class="webpers"></div></a></li>
            <li><a href="https://www.facebook.com/pages/Webpers/245892612091499" style="overflow:hidden"><div class="webpers_facebook"></div></a></li>
            <li><a href="#" style="overflow:hidden"><div class="webpers_twitter"></div></a></li>
        </ul>
        
        
        
    </div>
</div>
<script type="text/javascript" />
function blink(selector){
$(selector).fadeOut(500, function(){
    $(this).fadeIn(500, function(){
        blink(this);
    });
});
}



blink('#blink_2');
blink('#blinking_info');
</script>


</body>
</html>
